home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / Toolbar.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  4.3 KB  |  128 lines

  1. /* The beauty of Toolbar */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  8. call RxMUIOpt("debugmode showerr")
  9. call ProgDir()
  10. call Pragma("W","N")
  11.  
  12. call CreateApp(f)
  13. call HandleApp
  14. /* never reached */
  15. /***********************************************************************/
  16. HandleApp: procedure expose pic
  17.  
  18.     ctrl_c=2**12
  19.     do forever
  20.         call NewHandle("app","h",ctrl_c)
  21.         if and(h.signals,ctrl_c)>0 then exit
  22.         select
  23.             when h.event="QUIT" then exit
  24.             otherwise say h.event
  25.         end
  26.     end
  27.     /* never reached */
  28. /***********************************************************************/
  29. err: procedure expose sigl rxmuierror
  30. parse arg res
  31. say sigl "["res"]"
  32.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  33.     exit
  34. /***********************************************************************/
  35. CreateApp: procedure expose pic
  36. parse arg f
  37.  
  38.     app.Title="ToolbarExample"
  39.     app.Version="$VER: ToolbarExample 1.0 (23.3.2001)"
  40.     app.Copyright="©2001, alfie"
  41.     app.Author="alfie"
  42.     app.Description="ToolbarExample"
  43.     app.Base="RXMUIEXAMPLE"
  44.     app.SubWindow="win"
  45.      win.ID="MAIN"
  46.      win.Title="Toolbar example"
  47.      win.Contents="MGROUP"
  48.  
  49.       mgroup.0="tbg"
  50.        tbg.class="virtgroup"
  51.        tbg.horiz=1
  52.         tbg.0="tb"
  53.          tb.Class="Toolbar"
  54.          tb.Font="Tiny"
  55.          tb.Path="YAM:Icons/"
  56.          tb.ImageNormal="Main.toolbar"
  57.          tb.ImageSelect="Main_S.toolbar"
  58.          tb.ImageGhost="Main_G.toolbar"
  59.          tb.ParseUnderscore=1
  60.          tb.ShortHelp=1
  61.           tb.0.Type= "BUTTON"; tb.0.Text="_Read";
  62.           tb.1.Type= "BUTTON"; tb.1.Text="_Edit";
  63.           tb.2.Type= "BUTTON"; tb.2.Text="_Move";
  64.           tb.3.Type= "BUTTON"; tb.3.Text="_Delete";
  65.           tb.4.Type= "BUTTON"; tb.4.Text="_GetAdd";
  66.           tb.5.Type= "SPACE"
  67.           tb.6.Type= "BUTTON"; tb.6.Text="_New";
  68.           tb.7.Type= "BUTTON"; tb.7.Text="_Reply";
  69.           tb.8.Type= "BUTTON"; tb.8.Text="_Forward";
  70.           tb.9.Type= "SPACE"
  71.           tb.10.Type="BUTTON"; tb.10.Text="_Get";
  72.           tb.11.Type="BUTTON"; tb.11.Text="_Forward"; tb.11.Flags="toggle"
  73.           tb.12.Type="SPACE"
  74.           tb.13.Type="BUTTON"; tb.13.Text="_Filter"; tb.13.Exlude=2**14+2**15+2**16; tb.13.Flags="selected"
  75.           tb.14.Type="BUTTON"; tb.14.Text="_Find";   tb.14.Exlude=2**13+2**15+2**16
  76.           tb.15.Type="BUTTON"; tb.15.Text="_Addr";   tb.15.Exlude=2**13+2**14+2**16
  77.           tb.16.Type="BUTTON"; tb.16.Text="_Config"; tb.16.Exlude=2**13+2**14+2**15
  78.         tbg.1=hspace()
  79.  
  80.       mgroup.1=hbar()
  81.  
  82.       mgroup.2="cg"
  83.        cg.class="group"
  84.        cg.columns=2
  85.         cg.0=label("Exclude")
  86.         cg.1=MakeObj(,"HLeft",MakeObj("ra","radio","Filter|Find|Addr|Config",,,1))
  87.         cg.2=label("Disable _0")
  88.         cg.3=MakeObj(,"HLeft",CheckMark("c0",,'0'))
  89.         cg.4=label("Gone _1")
  90.         cg.5=MakeObj(,"HLeft",CheckMark("c1",,'1'))
  91.         cg.6=label("Disable toolbar")
  92.         cg.7=MakeObj(,"HLeft",CheckMark("c2"))
  93.  
  94.     res=NewObj("APPLICATION","APP")
  95.     if res~=0 then do
  96.         call PrintFault()
  97.         exit
  98.     end
  99.  
  100.     call set("win","open",1)
  101.  
  102.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  103.  
  104.     call Notify("ra","active",0,"tb","tbset",13,"selected",1)
  105.     call Notify("ra","active",1,"tb","tbset",14,"selected",1)
  106.     call Notify("ra","active",2,"tb","tbset",15,"selected",1)
  107.     call Notify("ra","active",3,"tb","tbset",16,"selected",1)
  108.  
  109.     call TBNotify("tb",0,"pressed",0,"app","return","TB0")
  110.     call TBNotify("tb",1,"pressed",0,"app","return","TB1")
  111.     call TBNotify("tb",3,"pressed",0,"app","return","TB3")
  112.     call TBNotify("tb",13,"pressed",1,"ra","set","active",0)
  113.     call TBNotify("tb",14,"pressed",1,"ra","set","active",1)
  114.     call TBNotify("tb",15,"pressed",1,"ra","set","active",2)
  115.     call TBNotify("tb",16,"pressed",1,"ra","set","active",3)
  116.  
  117.     call Notify("c0","selected","everytime","tb","tbset",0,"ghosted","triggervalue")
  118.     call Notify("c1","selected","everytime","tb","tbset",1,"Gone","triggervalue")
  119.     call Notify("c2","selected","everytime","tb","tbsetall","ghosted","triggervalue")
  120.  
  121.     return
  122. /***********************************************************************/
  123. halt:
  124. break_c:
  125.     exit
  126. /**************************************************************************/
  127.  
  128.